package com.xique.system.api;

import com.xique.common.core.constant.ServiceNameConstants;
import com.xique.common.core.domain.R;
import com.xique.system.api.dto.SystemDeptDTO;
import com.xique.system.api.factory.RemoteSystemDeptFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 部门服务
 *
 * @author xique
 */
@FeignClient(contextId = "RemoteSystemDeptService", value = ServiceNameConstants.SYSTEM_BIZ_SERVICE,
        fallbackFactory = RemoteSystemDeptFallbackFactory.class)
public interface RemoteSystemDeptService {

    /**
     * 根据部门编号获取详细信息
     *
     * @param id 部门ID
     * @return 查询结果
     */
    @GetMapping(value = "dept/info/{id}")
    R<SystemDeptDTO> getInfoById(@PathVariable("id") Long id);

    /**
     * 获取所有部门
     *
     * @return 查询结果
     */
    @GetMapping(value = "dept/allList")
    R<List<SystemDeptDTO>> allList();

}
